#pragma once
#include <QString>

enum ConsoleRole {
	CONSOLE_ERR,
	CONSOLE_OUT
};

class Log
{
public:
	static void writeConsole(const char* err,ConsoleRole role = CONSOLE_OUT);
	static void writeConsole(const QString&err,ConsoleRole role = CONSOLE_OUT);

	static void writeErr(const char* err);
	static void writeErr(const QString& err);

	static void writeLog(const char* log);
	static void writeLog(const QString& log);
	static void closeLogFile();

	~Log() {
		closeLogFile();
	}

private:
	static Log LogInstance;
	static FILE* getLogFile();
	static FILE* m_LogFile;
};